$(document).ready(function() {
	
	setDatePicker('frmAddCustomer_dob');

});

$(document).ready(function() {

	// validate signup form on keyup and submit
	$("#frmAddCustomer").validate({
		rules: {
			"customerInfo.emailAddress": {
				required: true,
				email: true
			},
			"customerInfo.password": {
				required: true,
				minlength: 6
			},
			"customerInfo.rePassword": {
				required: true,
				minlength: 6,
				equalTo: "#frmAddCustomer_password"
			},
			"customerInfo.dob": {
				required: true,
				date: true
			}
		},
		messages: {
			"customerInfo.emailAddress": {
				required: "Email is required",
				email:  "Please enter a valid email address"
			},
			"customerInfo.password": {
				required: "Password is required",
				minlength: "Your password must be at least 6 characters long"
			},
			"customerInfo.rePassword": {
				required: "Re-Password is required",
				minlength: "Your password must be at least 6 characters long",
				equalTo: "Please enter the same password as above"
			},
			"customerInfo.dob": {
				required: "Birth of date is required",
				date: "Birth of date is invalid"
			}
		}
	});

});


